package net.csdn.business.notify.common.model.vo;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;
import net.csdn.business.notify.common.enums.ProcessStatusEnum;
import net.csdn.business.notify.common.pipeline.param.MessageParam;

import java.util.ArrayList;
import java.util.List;


/**
 * @author zzb
 * @since 2021.11.17
 */

@Getter
@ToString(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
public final class BasicResultVO {

    /**
     * 响应状态
     */
    private int status;
    /**
     * 响应信息
     */
    private String msg;

    /**
     * 流程处理开始的任务总数
     */
    private Integer total=0;



    /**
     * 流程处理完毕失败任务总数
     */
    private List<MessageParam> failList=new ArrayList<>();



    /**
     * @return 默认成功响应
     */
    public static BasicResultVO success() {
        return new BasicResultVO(ProcessStatusEnum.SUCCESS);
    }



    public BasicResultVO(ProcessStatusEnum status) {
        this.status = status.getCode();
        this.msg = status.getMsg();
    }
}
